#!/usr/bin/env python

import subprocess, time, os, sys

def instance(n, m):
	text = str(n) + " " + str(m) + "\n"
	for i in range(n):
		for j in range(m):
			text += "1 "
		text += "\n"
	#print(text)
	return text

def instanceFromFile(path):
	f = open(path)
	text = ""
	for line in f:
		text += line
	return text

def launch(input):
	command = ["bin\\nocheMuseo.exe"]
	subp = subprocess.Popen(command,
		stdout=subprocess.PIPE,
		stdin=subprocess.PIPE,
		stderr=subprocess.STDOUT)
	stdout = subp.communicate(input=input)[0]
	return int(stdout.strip())

iters = 50

for n in range(10):
	value = 0;
	for i in range(iters):
		value += launch(instanceFromFile("../test/obj2/5x5-test" + str(n+1) + ".txt"))
	print(str(n) + " " + str(value/iters))